package com.sharp.portal.dao.repository;

import com.sharp.kernel.constant.db.SqlConstant;
import com.sharp.kernel.mybatis.repository.BaseMysqlRepository;
import com.sharp.portal.dao.entity.CoPortal;
import com.sharp.portal.dao.mapper.CoPortalDao;
import org.springframework.stereotype.Service;

/**
 * Title: CoPortalRepository
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/6/9 18:00
 */
@Service
public class CoPortalService extends BaseMysqlRepository<CoPortal, CoPortalDao> {

    private static final String DEFAULT_CONDITION = "[]";

    public CoPortal createCoPortal(String path, String value, String description, String dbName, String tableName) {
        CoPortal coPortal = new CoPortal();
        coPortal.setPath(path);
        coPortal.setValue(value);
        coPortal.setDescription(description);
        coPortal.setSqlDbName(dbName);
        coPortal.setSqlTableName(tableName);
        coPortal.setValid(SqlConstant.VALID);
        super.insert(coPortal);
        return coPortal;
    }
}
